import 'package:floor/floor.dart';
import 'package:flutter_getx/app/data/db/entity/user_friend.dart';

@dao
abstract class UserFriendDao {
  @Query('SELECT * FROM UserFriendEntity')
  Future<List<UserFriendEntity>> findAllUserFriends();

  @Query('SELECT * FROM UserFriendEntity WHERE id = :id')
  Stream<UserFriendEntity?> findUserFriendById(int id);

  @insert
  Future<void> insertUserFriend(UserFriendEntity userFriend);

  @insert
  Future<List<int>> insertUserFriends(List<UserFriendEntity> userFriend);

  @Update(onConflict: OnConflictStrategy.replace)
  Future<void> updateUserFriend(UserFriendEntity userFriend);

  @delete
  Future<void> deleteUserFriend(UserFriendEntity userFriend);

  @Query('DELETE FROM UserFriendEntity')
  Future<void> deleteAll();
}
